Transaction feature generation

ABSTRACT

The present specification discloses a method and an apparatus for training a transaction feature generation model, and a method and an apparatus for generating a transaction feature. The method for generating a transaction feature can include the following: obtaining a target dataset, where the target dataset includes some pieces of transaction data; obtaining some original features of the transaction data and determining one or more combination methods for the original features; determining a feature vector of a new feature that is obtained by combining the original features based on each combination method; inputting the feature vector into a trained transaction feature generation model, and outputting a prediction result of the new feature; and selecting some new features whose prediction results meet a specified condition as transaction features generated for the target dataset.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of PCT Application No.PCT/CN2020/070847, filed on Jan. 8, 2020, which claims priority toChinese Patent Application No. 201910457803.2, filed on May 29, 2019,and each application is hereby incorporated by reference in itsentirety.

TECHNICAL FIELD

The present specification relates to the field of machine learningtechnologies, and in particular to a method and an apparatus fortraining a transaction feature generation model, and a method and anapparatus for generating a transaction feature.

BACKGROUND

In the field of machine learning technologies, features input into amachine learning model usually depend on artificial experience summary.It requires technicians to have a lot of prior knowledge, and a lot oftime needs to be consumed for verification, causing low featuregeneration efficiency.

SUMMARY

The present specification provides a method and an apparatus fortraining a transaction feature generation model, and a method and anapparatus for generating a transaction feature.

The present specification is implemented by using the followingtechnical solutions:

A method for generating a transaction feature is provided, where thetransaction feature is used to identify an illegal transaction, and themethod includes the following: obtaining a target dataset, where thetarget dataset includes some pieces of transaction data; obtaining someoriginal features of the transaction data and determining one or morecombination methods for the original features; determining a featurevector of a new feature that is obtained by combining the originalfeatures based on each combination method; inputting the feature vectorinto a trained transaction feature generation model, and outputting aprediction result of the new feature; and selecting some new featureswhose prediction results meet a specified condition as transactionfeatures generated for the target dataset.

A method for training a transaction feature generation model includesthe following: obtaining a sample dataset, where the sample datasetincludes some pieces of sample transaction data with a transactionlabel, and the transaction label is used to mark whether thecorresponding sample transaction data is an illegal transaction;obtaining some original features of the sample transaction data anddetermining one or more combination methods for the original features;determining a feature vector of a new feature that is obtained bycombining the original features based on each combination method;calculating a difference between the new feature and the transactionlabel as a feature label of the new feature; and training thetransaction feature generation model based on the feature vector and thefeature label of the new feature.

A feature generation method includes the following: obtaining a targetdataset, where the target dataset includes some pieces of data;obtaining some original features of the data and determining one or morecombination methods for the original features; determining a featurevector of a new feature that is obtained by combining the originalfeatures based on each combination method; inputting the feature vectorinto a trained feature generation model, and outputting a predictionresult of the new feature; and selecting some new features whoseprediction results meet a specified condition as features generated forthe target dataset.

An apparatus for generating a transaction feature is provided, where thetransaction feature is used to identify an illegal transaction, and theapparatus includes the following: a dataset acquisition unit, configuredto obtain a target dataset, where the target dataset includes somepieces of transaction data; a feature acquisition unit, configured toobtain some original features of the transaction data and determine oneor more combination methods for the original features; a featurecombination unit, configured to determine a feature vector of a newfeature that is obtained by combining the original features based oneach combination method; a feature prediction unit, configured to inputthe feature vector into a trained transaction feature generation model,and output a prediction result of the new feature; and a featuregeneration unit, configured to select some new features whose predictionresults meet a specified condition as transaction features generated forthe target dataset.

An apparatus for training a transaction feature generation modelincludes the following: a sample acquisition unit, configured to obtaina sample dataset, where the sample dataset includes some pieces ofsample transaction data with a transaction label, and the transactionlabel is used to mark whether the corresponding sample transaction datais an illegal transaction; a feature acquisition unit, configured toobtain some original features of the sample transaction data anddetermine one or more combination methods for the original features; afeature combination unit, configured to determine a feature vector of anew feature that is obtained by combining the original features based oneach combination method; a difference calculation unit, configured tocalculate a difference between the new feature and the transaction labelas a feature label of the new feature; and a model training unit,configured to train the transaction feature generation model based onthe feature vector and the feature label of the new feature.

An apparatus for generating a transaction feature includes thefollowing: a processor; and a memory, configured to store a machineexecutable instruction, where by reading and executing a machineexecutable instruction that is stored in the memory and corresponds togeneration logic of the transaction feature, the processor is enabled toperform the following operations: obtaining a target dataset, where thetarget dataset includes some pieces of transaction data; obtaining someoriginal features of the transaction data and determining one or morecombination methods for the original features; determining a featurevector of a new feature that is obtained by combining the originalfeatures based on each combination method; inputting the feature vectorinto a trained transaction feature generation model, and outputting aprediction result of the new feature; and selecting some new featureswhose prediction results meet a specified condition as transactionfeatures generated for the target dataset.

An apparatus for training a transaction feature generation modelincludes the following: a processor; and a memory, configured to store amachine executable instruction, where by reading and executing a machineexecutable instruction that is stored in the memory and corresponds totraining logic of the transaction feature generation model, theprocessor is enabled to perform the following operations: obtaining asample dataset, where the sample dataset includes some pieces of sampletransaction data with a transaction label, and the transaction label isused to mark whether the corresponding sample transaction data is anillegal transaction; obtaining some original features of the sampletransaction data and determining one or more combination methods for theoriginal features; determining a feature vector of a new feature that isobtained by combining the original features based on each combinationmethod; calculating a difference between the new feature and thetransaction label as a feature label of the new feature; and trainingthe transaction feature generation model based on the feature vector andthe feature label of the new feature.

It can be seen from the previous description that, in someimplementations, the original features of the data can be combined toobtain some new features, and then the trained feature generation modelis used to predict the new features, and some new features whoseprediction results meet the specified condition can be selected as thenewly generated features for later data prediction, therebyautomatically generating features and greatly improving featuregeneration efficiency.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic flowchart illustrating a method for training atransaction feature generation model, according to an exampleimplementation of the present specification;

FIG. 2 is a schematic flowchart illustrating a method for generating atransaction feature, according to an example implementation of thepresent specification;

FIG. 3 is a schematic flowchart illustrating a feature generationmethod, according to an example implementation of the presentspecification;

FIG. 4 is a schematic structural diagram illustrating an apparatus forgenerating a transaction feature, according to an example implementationof the present specification;

FIG. 5 is a block diagram illustrating an apparatus for generating atransaction feature, according to an example implementation of thepresent specification;

FIG. 6 is a schematic structural diagram illustrating an apparatus fortraining a transaction feature generation model, according to an exampleimplementation of the present specification; and

FIG. 7 is a block diagram illustrating an apparatus for training atransaction feature generation model, according to an exampleimplementation of the present specification.

DESCRIPTION OF IMPLEMENTATIONS

Example implementations are described in detail here, and examples ofthe example implementations are presented in the accompanying drawings.When the following description relates to the accompanying drawings,unless specified otherwise, same numbers in different accompanyingdrawings represent same or similar elements. Implementations describedin the following example implementations do not represent allimplementations consistent with the present specification. On thecontrary, the implementations are only examples of apparatuses andmethods that are described in the appended claims in detail andconsistent with some aspects of the present specification.

The terms used in the present specification are merely for illustratingspecific implementations, and are not intended to limit the presentspecification. The terms “a” and “the” of singular forms used in thepresent specification and the appended claims are also intended toinclude plural forms, unless otherwise specified in the context clearly.It should be further understood that the term “and/or” used in thepresent specification indicates and includes any or all possiblecombinations of one or more associated listed items.

It should be understood that although terms “first”, “second”, “third”,etc. may be used in the present specification to describe various typesof information, the information should not be limited by these terms.These terms are only used to differentiate between information of thesame type. For example, without departing from the scope of the presentspecification, first information can also be referred to as secondinformation, and similarly, the second information can also be referredto as the first information. Depending on the context, for example, theword “if” used here can be explained as “while”, “when”, or “in responseto determining”.

According to the solutions for generating a transaction feature providedin the present specification, the original features of the transactiondata can be combined to obtain some new features, and then the trainedtransaction feature generation model is used to predict the newfeatures, and some new features whose prediction results meet thespecified condition can be selected as the newly generated features forlater illegal transaction identification, thereby automaticallygenerating transaction features and greatly improving transactionfeature generation efficiency.

The following separately describes the specific implementation processof the present specification from the perspective of training atransaction feature generation model and from the perspective ofgenerating a transaction feature.

FIG. 1 is a schematic flowchart illustrating a method for training atransaction feature generation model, according to an exampleimplementation of the present specification.

Referring to FIG. 1, the method for training a transaction featuregeneration model can include the following steps:

Step 102: Obtain a sample dataset, where the sample dataset includessome pieces of sample transaction data with a transaction label, and thetransaction label is used to mark whether the corresponding sampletransaction data is an illegal transaction.

In the present implementation, transaction data for which illegaltransaction identification has been performed can be obtained as sampletransaction data with a transaction label. The transaction label is usedto mark whether the corresponding sample transaction data is an illegaltransaction. The illegal transaction can include a cash-out transaction,a money laundering transaction, etc.

For example, the transaction label “0” can indicate that thecorresponding sample transaction data is not an illegal transaction; thetransaction label “1” can indicate that the corresponding sampletransaction data is an illegal transaction, and so on.

In the present implementation, sample transaction data can be classifiedbased on an application scenario, and sample transaction data in thesame application scenario is classified into the same sample dataset.

A certain e-commerce platform is used as an example. Sample transactiondata traded by using the e-commerce platform can be classified intosample dataset 1.

A certain consumer credit product is used as another example. Sampletransaction data for which payment is made by using the consumer creditproduct can be classified into sample dataset 2.

In the present implementation, one or more sample datasets can beobtained, which is not specially limited in the present specification.

Step 104: Obtain some original features of the sample transaction dataand determine one or more combination methods for the original features.

In the present implementation, the original features are features of thesample transaction data, such as a transaction amount, the number oftransactions, a distance between a transaction location and a merchant,a merchant category, a user category, etc.

Types of different original features may be the same or different. Forexample, the type of the transaction amount is a numeric type, the typeof the number of transactions is a numeric type, the type of themerchant category is a string, and the type of the user category is astring, and so on.

The numeric type can be subdivided into a floating-point type and aninteger type.

The transaction amount is of the floating-point type, for example, thetransaction amount is 108.75 yuan, and so on.

The number of transactions is of the integer type, for example, thenumber of transactions is 5, and so on.

The present specification does not impose a limitation on theclassification of the types of the original features.

For example, the floating-point type and the integer type can be unifiedinto the numeric type without distinction.

For another example, the floating-point type, the integer type, etc. canbe used as the types of the original features, and the numeric type isnot preserved.

In the present implementation, for ease of feature combination, whenoriginal features in the sample dataset are obtained, some originalfeatures of the same type can be obtained each time, and the number ofthe obtained original features can be 2, 3, etc., which is not speciallylimited in the present specification.

In an example, some original features of the same type can be obtained.

Original features of the floating-point type are used as an example. Theoriginal feature “total transaction amount of the user last month” andthe original feature “total transaction amount of the user in the sameperiod of last year” can be obtained.

Original features of the integer type are used as an example. Theoriginal feature “number of transactions on yesterday” and the originalfeature “number of transactions on the day before yesterday” can beobtained.

In other examples, when original features of different types can becombined, some original features of different types can be obtained.

For example, the original feature “total transaction amount in the past30 days” of the floating-point type and the original feature “number oftransactions in the past 30 days” of the integer type are obtained.

It is worthwhile to note that, when original features are obtained, iftwo original features cannot be combined, the two original features willnot be obtained at the same time.

For example, the original feature “user category” of the string type andthe original feature “number of transactions in the past 30 days” of theinteger type will not be obtained at the same time because the twooriginal features cannot be combined.

In the present implementation, for ease of description, some originalfeatures obtained each time can be referred to as one original featuregroup. In the present step, acquisition can be performed multiple timesto obtain multiple original feature groups.

It is worthwhile to note that, in the present implementation, originalfeatures are usually obtained per sample dataset, and are not obtainedacross sample datasets. In other words, all original features in eachoriginal feature group come from the same sample dataset.

In the present implementation, for each obtained original feature group,a combination method that matches a type of original features can bedetermined for the original features in the original feature group.

Original features of the numeric type are used as an example. Thecombination method can include four arithmetic operations such asaddition, subtraction, multiplication, and division, logarithmic sumcalculation, quadratic sum calculation, and the like operation methods.The combination method can also be first sorting the original featuresin terms of magnitude, and then abstracting some original features basedon the sorting result to perform four arithmetic operations, quadraticsum calculation, or the like operations, which is not specially limitedin the present specification.

For example, assume that original features in a certain original featuregroup are “number of transactions on yesterday” and “number oftransactions on the day before yesterday”. The combination method can besubtraction. For example, “number of transactions on yesterday” issubtracted by “number of transactions on the day before yesterday” toobtain a difference in the number of transactions.

Original features of the string type are used as an example. Thecombination method can be an operation on string lengths of the originalfeatures, for example, four arithmetic operations on the string lengths.For a specific operation method, references can be made to thecombination method for the original features of the numeric type.Details are omitted here for simplicity.

Step 106: Determine a feature vector of a new feature that is obtainedby combining the original features based on each combination method.

In the present implementation, for each original feature group obtainedin step 104, one new feature can be obtained by combining the originalfeatures in the original feature group based on one combination method.Some new features can be obtained by combining the original features invarious original feature groups based on various combination methods.

In the present step, a feature vector of each new feature can bedetermined.

In an example, original features in a sample dataset can be combinedbased on a combination method, and a value of a new feature obtainedthrough the combination can be used as a feature vector of the newfeature.

For example, assume that an original feature group obtained from acertain sample dataset includes two original features of the numerictype: original feature a and original feature b; the combination methodis addition; there are 100 pieces of transaction data in total in thesample dataset; values of original feature a are respectively [a₁, a₂, .. . , a₁₀₀]; values of original feature b are respectively [b₁, b₂, . .. , b₁₀₀]. Original feature a and original feature b are combined bymeans of addition, and a feature vector of the obtained new feature a+bcan be [a₁+b₁, a₂+b₂, . . . , a₁₀₀+b₁₀₀].

In another example, to reduce a computation amount, the feature vectorof the new feature can also be generated based on meta information ofthe original features and the combination method.

The meta information of the original features can include an averagevalue, a variance, and the number of unique data of the originalfeatures in the sample dataset. The meta information of each originalfeature can form one meta information vector.

A presentation form of the combination method can be a 0/1 vector(Onehot vector), or can be a low-dimension vector obtained by performingembedding processing on the 0/1 vector. The 0/1 vector means that a verylong vector is used to represent the combination method. Dimensions ofthe vector are the total number of the combination methods, and eachdimension corresponds to one unique combination method. If a certaincombination method is used, an element value of a dimension of thecombination method is 1. If a certain combination method is not used, anelement value of a dimension of the combination method is 0.

Assume that there are 80 combination methods in total. The 0/1 vector ofthe combination methods has 80 dimensions, and each dimensioncorresponds to one unique combination method. The previous addition isstill used as an example. In the 80-dimension 0/1 vector, an elementvalue of the dimension corresponding to the addition is 1, and elementvalues of other dimensions are all 0. To be specific, an element valueof one element in the 80-dimension 0/1 vector is 1, and element valuesof the other 79 elements are all 0.

Original feature a and original feature b described above are still usedas an example. A feature vector of a new feature can be generated basedon a meta information vector of original feature a, a meta informationvector of original feature b, and the 0/1 vector of the combinationmethod. For simplicity, these three vectors can be spliced together toobtain the feature vector of the new feature.

In other examples, when there are multiple sample datasets, that is,when the number of sample datasets is greater than 1, the feature vectorof the new feature can be generated based on the meta information of theoriginal features, the combination method, and meta features of thesample datasets.

The meta features of the sample datasets can include a ratio (a ratio ofpositive and negative samples) of an amount of sample transaction datamarked as legal transactions to an amount of sample transaction datamarked as illegal transactions in the sample datasets, the number oforiginal features, the number of original features of the numeric type,the number of original features of the string type, etc. The metafeatures of the sample datasets can form one meta feature vector.

In the present example, the meta information vector of the originalfeatures, the 0/1 vector of the combination method, and the meta featurevector of the sample datasets can be spliced together to obtain thefeature vector of the new feature.

Step 108: Calculate a difference between the new feature and thetransaction label as a feature label of the new feature.

In the present implementation, a smaller difference between the newfeature obtained through the combination and the transaction label ofeach piece of sample transaction data can indicate a more reliable newfeature obtained. Therefore, in the present example, the differencebetween the new feature and the transaction label is used as the featurelabel of the new feature.

In the present implementation, for each piece of sample transaction datain the sample dataset, the value of the new feature of each piece ofsample transaction data can be calculated based on the combinationmethod; and then a transaction label of the sample transaction data canbe used as a real value, a mean square error between the value of thenew feature of the sample transaction data and the real value can becalculated, and the mean square error can be used as the differencebetween the new feature and the transaction label.

In the present implementation, the feature label of the new feature canbe calculated by using the following formula:

$C = \frac{\sum\limits_{1}^{N}\left( {{fab}_{i} - l_{i}} \right)^{2}}{N}$

The combination of original feature a and original feature b is stillused as an example. In the previous formula, C represents the featurelabel of the new feature ab, N represents the number of the sampletransaction data in the sample dataset, fab_(i) represents a value of anew feature ab of an ith piece of sample transaction data, and l_(i)represents a transaction label of the ith piece of sample transactiondata, where a value of i ranges from 1 to N.

In other examples, the difference between the new feature and thetransaction label can also be calculated by using algorithms such asEuclidean distance and Mahalanobis distance, which is not speciallylimited in the present specification.

Step 110: Train the transaction feature generation model based on thefeature vector and the feature label of the new feature.

Based on steps 106 and 108, the feature vector of the new feature can beinput into the transaction feature generation model, and a predictionresult of the new feature can be output. Then, a difference between theprediction result and the feature label of the new feature can becalculated, and parameters of the transaction feature generation modelcan be adjusted based on the difference to train the transaction featuregeneration model.

In the present implementation, a machine learning model undersupervision can be used as the transaction feature generation model,such as a neural network model, which is not specially limited in thepresent specification.

FIG. 2 is a schematic flowchart illustrating a method for generating atransaction feature, according to an example implementation of thepresent specification.

Referring to FIG. 2, the method for generating a transaction feature caninclude the following steps:

Step 202: Obtain a target dataset, where the target dataset includessome pieces of transaction data.

In the present implementation, for a certain application scenario forwhich illegal transaction identification is needed, transaction data inthe application scenario can be obtained to obtain a target dataset.

For example, transaction data for which illegal transactionidentification has been performed in the scenario can be obtained toobtain a target dataset. Transaction data in the target dataset has atransaction label.

For another example, when illegal transaction identification has notbeen performed for the transaction data in the scenario, the transactiondata without a transaction label in the scenario can also be obtained toobtain the target dataset, which is not specially limited in the presentspecification.

The illegal transaction can include a cash-out transaction, a moneylaundering transaction, etc.

Step 204: Obtain some original features of the transaction data anddetermine one or more combination methods for the original features.

In the present implementation, the original features are features of thetransaction data in the target dataset, such as a transaction amount,the number of transactions, a distance between a transaction locationand a merchant, a merchant category, etc.

In the present implementation, some original feature groups can beobtained from the target dataset, each original feature group includessome original features, and a combination method can be determined fororiginal features in each original feature group.

For the method for obtaining the original features and the method fordetermining the combination method, references can be made to step 104in the implementation shown in FIG. 1. Details are omitted here forsimplicity.

Step 206: Determine a feature vector of a new feature that is obtainedby combining the original features based on each combination method.

In the present implementation, for each original feature group obtainedin step 204, one new feature can be obtained by combining the originalfeatures in the original feature group based on one combination method.Some new features can be obtained by combining the original features inall original feature groups based on various combination methods.

In the present step, a feature vector of each new feature can bedetermined.

In an example, original features in a sample dataset can be combinedbased on a combination method, and a value of a new feature obtainedthrough the combination can be used as a feature vector of the newfeature.

In another example, the feature vector of the new feature can also begenerated based on meta information of the original features and thecombination method.

In other examples, when there are multiple sample datasets that are usedto train the transaction feature generation model, the feature vector ofthe new feature can be generated based on the meta information of theoriginal features, the combination method, and meta features of thedatasets.

The meta features of the datasets can include the number of originalfeatures, the number of original features of the numeric type, thenumber of original features of the string type, a ratio of positive andnegative samples (if any), etc.

For a method for generating the previous feature vector, references canbe made to the method for generating a feature vector described in step106 in the implementation shown in FIG. 1. Details are omitted here forsimplicity.

Step 208: Input the feature vector into a trained transaction featuregeneration model, and output a prediction result of the new feature.

Step 210: Select some new features whose prediction results meet aspecified condition as transaction features generated for the targetdataset.

In the present implementation, the feature vectors of all new featurescan be input into the trained transaction feature generation model, andthe prediction results of the new features can be output, and then thenew features can be sorted in ascending order of the prediction results.Calculation of the difference between the new feature and thetransaction label by using the Euclidean distance algorithm is used asan example. A smaller prediction result indicates a smaller differencebetween the new feature and the transaction label, and a more reliablenew feature.

In the present implementation, after the sorting, new features ranked inthe first N positions can be selected as the new transaction featuresgenerated for the target dataset. A value of N can be predetermined.

In the present implementation, after the newly generated transactionfeatures are determined for the target dataset, illegal transactionidentification can be performed for the transaction data in the scenariothat the target dataset belongs to, based on the newly generatedtransaction features.

It can be seen from the previous description that, in the presentspecification, the original features of the transaction data can becombined to obtain some new features, and then the trained transactionfeature generation model is used to predict the new features, and somenew features whose prediction results meet the specified condition canbe selected as the newly generated transaction features for laterillegal transaction identification, thereby automatically generatingtransaction features and greatly improving transaction featuregeneration efficiency.

The present specification further provides a feature generation method.New features used for result prediction can be automatically generatedbased on original features, thereby improving feature generationefficiency.

Referring to FIG. 3, the feature generation method can include thefollowing steps:

Step 302: Obtain a target dataset, where the dataset includes somepieces of data.

In the present implementation, the target dataset is a dataset forgenerating a new feature. In different prediction tasks, the data in thetarget dataset may be different.

For example, in the task of illegal transaction identification, the datain the target dataset can be transaction data, and each piece oftransaction data can include original features such as a transactionamount and the number of transactions.

For another example, in the task of commodity recommendation, the datain the target dataset can be user data, and each piece of user data caninclude original features such as the user's age, the user's gender, theuser's purchase history, and the user's browsing history.

For another example, in the task of text classification, the data in thetarget dataset can be text data, and each piece of text data can includeoriginal features such as words and word frequencies included in thecorresponding text.

For another example, in the task of risky user identification, the datain the target dataset can be user data, and each piece of user data caninclude original features such as the user's age, the user's gender, andthe user's behavior trajectory.

Step 304: Obtain some original features of the data and determine one ormore combination methods for the original features.

In the present implementation, some original features of the same typecan be obtained from the original features of the data, and acombination method for these original features can be determined.

Certainly, in other examples, some original features of different typescan also be obtained from the original features of the data, and acombination method for these original features can be determined.

For acquisition of the original features and determining of thecombination method, references can be made to the acquisition of theoriginal features and the determining of the combination method in thetask of generating a transaction feature in the implementation shown inFIG. 2. Details are omitted here for simplicity.

Step 306: Determine a feature vector of a new feature that is obtainedby combining the original features based on each combination method.

In the present implementation, for each original feature group obtainedin step 304, one new feature can be obtained by combining the originalfeatures in the group based on one combination method. Some new featurescan be obtained by combining the original features in various groupsbased on various combination methods.

In the present step, a feature vector of each new feature can bedetermined.

For the method for determining the feature vector, references can bemade to the implementation shown in FIG. 1 or FIG. 2. Details areomitted here for simplicity.

Step 308: Input the feature vector into a trained feature generationmodel, and output a prediction result of the new feature.

Step 310: Select some new features whose prediction results meet aspecified condition as features generated for the target dataset.

In the present implementation, the feature generation model can betrained in the same method as the previous feature generation method toobtain a trained feature generation model.

In the training process, the difference between the new feature and thedata label can be used as the feature label of the new feature, so as toadjust the parameters of the feature generation model.

For a specific training process, references can be made to the processof training the transaction feature generation model in the transactionfeature generation scenario shown in FIG. 1. Details are omitted herefor simplicity.

In the present implementation, the feature vectors of all new featurescan be input into the trained feature generation model, and theprediction results of the new features can be output. Some new featureswhose prediction results meet a specified condition can be selected forlater result prediction for the data.

For example, assume that the prediction task is to perform riskidentification for the user to identify a risky user.

One sample or a sample dataset with a user label can be first used totrain the feature generation model, to obtain a trained featuregeneration model. The user label is used to mark whether thecorresponding user is a risky user.

For example, the feature generation model can be trained by using sampledataset 1 in a first transaction scenario and sample dataset 2 in asecond transaction scenario. Each piece of user data in sample dataset 1and sample dataset 2 has a user label.

After the trained feature generation model is obtained, for a thirdtransaction scenario for which risky user identification is needed, thetarget dataset can be obtained from the third transaction scenario.Then, the previous trained feature generation model is used to predict anew feature for the scenario. After the new feature is obtained throughprediction, the new feature can be used to predict user data in thethird transaction scenario, so as to predict whether the correspondinguser is a risky user.

It can be seen from the previous description that, in someimplementations, the original features of the data can be combined toobtain some new features, and then the trained feature generation modelis used to predict the new features, and some new features whoseprediction results meet the specified condition can be selected as thenewly generated features for later data prediction, therebyautomatically generating features and greatly improving featuregeneration efficiency.

Corresponding to the previous implementation of the method forgenerating a transaction feature, the present specification furtherprovides an implementation of an apparatus for generating a transactionfeature.

The implementation of the apparatus for generating a transaction featurein the present specification can be applied to a server. The apparatusimplementation can be implemented by software, or can be implemented byhardware or a combination of software and hardware. For example, theapparatus implementation is implemented by software. A logical apparatusis formed when a processor of a server where the apparatus is locatedreads a corresponding computer program instruction in a non-volatilememory into the memory for running. In terms of hardware, FIG. 4 is adiagram of a hardware structure of a server in which an apparatus forgenerating a transaction feature is located, according to the presentspecification. In addition to the processor, memory, network interface,and non-volatile memory shown in FIG. 4, the server in which theapparatus is located in the implementation generally can further includeother hardware based on an actual function of the server. Details areomitted here for simplicity.

FIG. 5 is a block diagram illustrating an apparatus for generating atransaction feature, according to an example implementation of thepresent specification.

Referring to FIG. 5, the apparatus 400 for generating a transactionfeature can be applied to the server shown in FIG. 4. The apparatus 400includes the following: a dataset acquisition unit 401, a featureacquisition unit 402, a feature combination unit 403, a featureprediction unit 404, and a feature generation unit 405.

The dataset acquisition unit 401 is configured to obtain a targetdataset, where the target dataset includes some pieces of transactiondata.

The feature acquisition unit 402 is configured to obtain some originalfeatures of the transaction data and determine one or more combinationmethods for the original features.

The feature combination unit 403 is configured to determine a featurevector of a new feature that is obtained by combining the originalfeatures based on each combination method.

The feature prediction unit 404 is configured to input the featurevector into a trained transaction feature generation model, and output aprediction result of the new feature.

The feature generation unit 405 is configured to select some newfeatures whose prediction results meet a specified condition astransaction features generated for the target dataset.

Optionally, the feature acquisition unit 402 is configured to obtainsome original features of the same type in the transaction data; anddetermine a combination method that matches the type as the combinationmethod for the original features.

Optionally, when the type is a numeric type, the combination methodincludes one or more of the following: four arithmetic operations,logarithmic sum calculation, or quadratic sum calculation.

Optionally, when the type is a string, the combination method includesone or more of the following: four arithmetic operations of stringlengths, a logarithmic sum of string lengths, or a quadratic sum ofstring lengths.

Optionally, the feature vector is generated based on meta information ofthe original features and the combination method.

Optionally, the meta information includes one or more of the following:an average value, a variance, or the number of unique data of theoriginal features.

Optionally, when the number of sample datasets for training thetransaction feature generation model is greater than 1, the featurevector is generated based on meta information of the original features,the combination method, and meta features of the datasets.

Optionally, the meta features of the datasets include one or more of thefollowing: the number of original features, the number of originalfeatures of the numeric type, or a ratio of positive and negativesamples.

Corresponding to the previous implementation of the method for traininga transaction feature generation model, the present specificationfurther provides an implementation of an apparatus for training atransaction feature generation model.

The implementation of the apparatus for training a transaction featuregeneration model in the present specification can be applied to aserver. The apparatus implementation can be implemented by software, orcan be implemented by hardware or a combination of software andhardware. For example, the apparatus implementation is implemented bysoftware. A logical apparatus is formed when a processor of a serverwhere the apparatus is located reads a corresponding computer programinstruction in a non-volatile memory into the memory for running. Interms of hardware, FIG. 6 is a diagram of a hardware structure of aserver in which an apparatus for training a transaction featuregeneration model is located, according to the present specification. Inaddition to the processor, memory, network interface, and non-volatilememory shown in FIG. 6, the server in which the apparatus is located inthe implementation generally can further include other hardware based onan actual function of the server. Details are omitted here forsimplicity.

FIG. 7 is a block diagram illustrating an apparatus for training atransaction feature generation model, according to an exampleimplementation of the present specification.

Referring to FIG. 7, the apparatus 600 for training a transactionfeature generation model can be applied to the server shown in FIG. 6.The apparatus 600 includes the following: a sample acquisition unit 601,a feature acquisition unit 602, a feature combination unit 603, adifference calculation unit 604, and a model training unit 605.

The sample acquisition unit 601 is configured to obtain a sampledataset, where the sample dataset includes some pieces of sampletransaction data with a transaction label, and the transaction label isused to mark whether the corresponding sample transaction data is anillegal transaction.

The feature acquisition unit 602 is configured to obtain some originalfeatures of the sample transaction data and determine one or morecombination methods for the original features.

The feature combination unit 603 is configured to determine a featurevector of a new feature that is obtained by combining the originalfeatures based on each combination method.

The difference calculation unit 604 is configured to calculate adifference between the new feature and the transaction label as afeature label of the new feature.

The model training unit 605 is configured to train the transactionfeature generation model based on the feature vector and the featurelabel of the new feature.

Optionally, the difference calculation unit 604 is configured to: foreach piece of sample transaction data in the sample dataset, calculate avalue of a new feature of the sample transaction data based on thecombination method; and use a transaction label of the sampletransaction data as a real value, calculate a mean square error betweenthe value of the new feature of the sample transaction data and the realvalue, and use the mean square error as the difference between the newfeature and the transaction label.

For an implementation process of functions and roles of each unit in theapparatus, references can be made to an implementation process ofcorresponding steps in the previous method. Details are omitted here forsimplicity.

Because an apparatus implementation corresponds to a methodimplementation, for related parts, references can be made to relateddescriptions in the method implementation. The previously describedapparatus implementation is merely an example. The units described asseparate parts can or cannot be physically separate, and parts displayedas units can or cannot be physical units, can be located in oneposition, or can be distributed on multiple network units. Some or allof the modules can be selected depending on an actual demand to achievethe objectives of the solutions of the present specification. A personof ordinary skill in the art can understand and implement theimplementations of the present specification without creative efforts.

The system, apparatus, module, or unit illustrated in the previousimplementations can be implemented by using a computer chip or anentity, or can be implemented by using a product having a certainfunction. A typical implementation device is a computer, and thecomputer can be a personal computer, a laptop computer, a cellularphone, a camera phone, a smartphone, a personal digital assistant, amedia player, a navigation device, an email receiving and sendingdevice, a game console, a tablet computer, a wearable device, or anycombination of these devices.

Corresponding to the previous implementation of the method forgenerating a transaction feature, the present specification furtherprovides an apparatus for generating a transaction feature. Theapparatus includes the following: a processor; and a memory, configuredto store a machine executable instruction. The processor and the memoryare usually interconnected by using an internal bus. In other possibleimplementations, the device can further include an external interface tocommunicate with other devices or components.

In the present implementation, by reading and executing a machineexecutable instruction that is stored in the memory and corresponds togeneration logic of the transaction feature, the processor is enabled toperform the following operations: obtaining a target dataset, where thetarget dataset includes some pieces of transaction data; obtaining someoriginal features of the transaction data and determining one or morecombination methods for the original features; determining a featurevector of a new feature that is obtained by combining the originalfeatures based on each combination method; inputting the feature vectorinto a trained transaction feature generation model, and outputting aprediction result of the new feature; and selecting some new featureswhose prediction results meet a specified condition as transactionfeatures generated for the target dataset.

Optionally, the obtaining some original features of the transaction dataincludes the following: obtaining some original features of the sametype in the transaction data; and the determining a combination methodfor the original features includes the following: determining acombination method that matches the type as the combination method forthe original features.

Optionally, when the type is a numeric type, the combination methodincludes one or more of the following: four arithmetic operations,logarithmic sum calculation, or quadratic sum calculation.

Optionally, when the type is a string, the combination method includesone or more of the following: four arithmetic operations of stringlengths, a logarithmic sum of string lengths, or a quadratic sum ofstring lengths.

Optionally, the feature vector is generated based on meta information ofthe original features and the combination method.

Optionally, the meta information includes one or more of the following:an average value, a variance, or the number of unique data of theoriginal features.

Optionally, when the number of sample datasets for training thetransaction feature generation model is greater than 1, the featurevector is generated based on meta information of the original features,the combination method, and meta features of the datasets.

Optionally, the meta features of the datasets include one or more of thefollowing: the number of original features, the number of originalfeatures of the numeric type, or a ratio of positive and negativesamples.

Corresponding to the previous implementation of the method for traininga transaction feature generation model, the present specificationfurther provides an apparatus for training a transaction featuregeneration model. The apparatus includes the following: a processor; anda memory, configured to store a machine executable instruction. Theprocessor and the memory are usually interconnected by using an internalbus. In other possible implementations, the device can further includean external interface to communicate with other devices or components.

In the present implementation, by reading and executing a machineexecutable instruction that is stored in the memory and corresponds totraining logic of the transaction feature generation model, theprocessor is enabled to perform the following operations: obtaining asample dataset, where the sample dataset includes some pieces of sampletransaction data with a transaction label, and the transaction label isused to mark whether the corresponding sample transaction data is anillegal transaction; obtaining some original features of the sampletransaction data and determining one or more combination methods for theoriginal features; determining a feature vector of a new feature that isobtained by combining the original features based on each combinationmethod; calculating a difference between the new feature and thetransaction label as a feature label of the new feature; and trainingthe transaction feature generation model based on the feature vector andthe feature label of the new feature.

Optionally, the obtaining some original features of the sampletransaction data includes the following: obtaining some originalfeatures of the same type in the sample transaction data; and thedetermining a combination method for the original features includes thefollowing: determining a combination method that matches the type as thecombination method for the original features.

Optionally, the calculating a difference between the new feature and thetransaction label includes the following: for each piece of sampletransaction data in the sample dataset, calculating a value of a newfeature of the sample transaction data based on the combination method;and using a transaction label of the sample transaction data as a realvalue, calculating a mean square error between the value of the newfeature of the sample transaction data and the real value, and using themean square error as the difference between the new feature and thetransaction label.

Corresponding to the previous implementation of the method forgenerating a transaction feature, the present specification furtherprovides a computer readable storage medium, where the computer readablestorage medium stores a computer program, and the program is executed bya processor to perform the following steps: obtaining a target dataset,where the target dataset includes some pieces of transaction data;obtaining some original features of the transaction data and determiningone or more combination methods for the original features; determining afeature vector of a new feature that is obtained by combining theoriginal features based on each combination method; inputting thefeature vector into a trained transaction feature generation model, andoutputting a prediction result of the new feature; and selecting somenew features whose prediction results meet a specified condition astransaction features generated for the target dataset.

Optionally, the obtaining some original features of the transaction dataincludes the following: obtaining some original features of the sametype in the transaction data; and the determining a combination methodfor the original features includes the following: determining acombination method that matches the type as the combination method forthe original features.

Optionally, when the type is a numeric type, the combination methodincludes one or more of the following: four arithmetic operations,logarithmic sum calculation, or quadratic sum calculation.

Optionally, when the type is a string, the combination method includesone or more of the following: four arithmetic operations of stringlengths, a logarithmic sum of string lengths, or a quadratic sum ofstring lengths.

Optionally, the feature vector is generated based on meta information ofthe original features and the combination method.

Optionally, the meta information includes one or more of the following:an average value, a variance, or the number of unique data of theoriginal features.

Optionally, when the number of sample datasets for training thetransaction feature generation model is greater than 1, the featurevector is generated based on meta information of the original features,the combination method, and meta features of the datasets.

Optionally, the meta features of the datasets include one or more of thefollowing: the number of original features, the number of originalfeatures of the numeric type, or a ratio of positive and negativesamples.

Corresponding to the previous implementation of the method for traininga transaction feature generation model, the present specificationfurther provides a computer readable storage medium, where the computerreadable storage medium stores a computer program, and the program isexecuted by a processor to perform the following steps: obtaining asample dataset, where the sample dataset includes some pieces of sampletransaction data with a transaction label, and the transaction label isused to mark whether the corresponding sample transaction data is anillegal transaction; obtaining some original features of the sampletransaction data and determining one or more combination methods for theoriginal features; determining a feature vector of a new feature that isobtained by combining the original features based on each combinationmethod; calculating a difference between the new feature and thetransaction label as a feature label of the new feature; and trainingthe transaction feature generation model based on the feature vector andthe feature label of the new feature.

Optionally, the obtaining some original features of the sampletransaction data includes the following: obtaining some originalfeatures of the same type in the sample transaction data; and thedetermining a combination method for the original features includes thefollowing: determining a combination method that matches the type as thecombination method for the original features.

Optionally, the calculating a difference between the new feature and thetransaction label includes the following: for each piece of sampletransaction data in the sample dataset, calculating a value of a newfeature of the sample transaction data based on the combination method;and using a transaction label of the sample transaction data as a realvalue, calculating a mean square error between the value of the newfeature of the sample transaction data and the real value, and using themean square error as the difference between the new feature and thetransaction label.

Specific implementations of the present specification are describedabove. Other implementations fall within the scope of the appendedclaims. In some situations, the actions or steps described in the claimscan be performed in an order different from the order in theimplementations and the desired results can still be achieved. Inaddition, the process depicted in the accompanying drawings does notnecessarily need a particular execution order to achieve the desiredresults. In some implementations, multi-tasking and concurrentprocessing is feasible or can be advantageous.

The previous descriptions are merely example implementations of thepresent specification, but are not intended to limit the presentspecification. Any modification, equivalent replacement, or improvementmade without departing from the spirit and principle of the presentspecification shall fall within the protection scope of the presentspecification.

What is claimed is:
 1. A computer-implemented method for evaluatingcombination transaction features, the method comprising: obtaining atarget dataset, wherein the target dataset comprises transaction data;obtaining transaction feature vectors having respective values for aplurality of original features represented in the transaction data;processing the transaction feature vectors to train a transactionfeature generation model that generates a predicted feature label for anew feature represented by a feature vector, including, for each newfeature of a plurality of new features, performing operationscomprising: determining, for the new feature, a respective combinationmethod for a respective original feature group comprising a plurality ofthe original features of the transaction data; generating values of thenew feature by combining corresponding values of the plurality of theoriginal features based on the respective combination method; computingthe feature label for the new feature based on a sum of differencesbetween the values of the new feature and corresponding transactionlabels; providing the feature vector for the new feature as a firstinput to the transaction feature generation model to obtain a predictionresult corresponding to the feature label, and updating parameters ofthe transaction feature generation model based on a difference betweenthe prediction result and the feature label for the new feature;receiving another new feature having a second combination method;computing a second feature vector for the other new feature according tothe second combination method; providing the second feature vector forthe other new feature as a second input to the transaction featuregeneration model to obtain a second prediction result for the other newfeature; evaluating the other new feature relative to one or moreadditional new features using the second prediction result for the othernew feature; selecting, based on the evaluation, the other new featureas a new transaction feature for training a model to classifytransactions; and using the other new feature to train the model toclassify transactions having original feature values including using thesecond combination method of the other new feature to combine originalfeature values of the transactions.
 2. The method according to claim 1,further comprising: obtaining the original features from the transactiondata wherein two or more of the original features obtained from thetransaction data are of a first data type; and wherein determining therespective combination method for the respective original feature groupcomprises: determining a combination method that matches the first datatype as the respective combination method for the respective originalfeature group.
 3. The method according to claim 2, wherein when thefirst data type is a numeric type, the respective combination methodcomprises one or more of the following: an arithmetic operation,logarithmic sum calculation, or quadratic sum calculation.
 4. The methodaccording to claim 2, wherein when the first data type is a string, therespective combination method comprises one or more of the following: anarithmetic operation of string lengths, a logarithmic sum of stringlengths, or a quadratic sum of string lengths.
 5. The method accordingto claim 1, wherein the second feature vector is generated based on metainformation of the original features and the second combination method.6. The method according to claim 5, wherein the meta informationcomprises one or more of the following: an average value, a variance, ora number of unique data of the original features.
 7. The methodaccording to claim 1, wherein computing the second feature vectorcomprises: computing the second feature vector based on meta informationof the original features, the second combination method, and metafeatures of two or more sample datasets used to train the transactionfeature generation model.
 8. The method according to claim 7, whereinthe meta features of the two or more sample datasets comprise one ormore of the following: a number of original features, a number oforiginal features of a numeric type, or a ratio of positive and negativesamples.
 9. The method according to claim 1, wherein the secondcombination method combines features of a same type as the respectivecombination method.
 10. The method according to claim 1, wherein thedifferences between the values of the new feature and the correspondingtransaction labels comprise a mean square error between a first value ofthe values of the new feature and a first transaction label of thecorresponding transaction labels.
 11. A non-transitory,computer-readable medium storing one or more instructions executable bya computer system to perform operations comprising: obtaining a targetdataset, wherein the target dataset comprises transaction data;obtaining transaction feature vectors having respective values for aplurality of original features represented in the transaction data;processing the transaction feature vectors to train a transactionfeature generation model that generates a feature label for a newfeature represented by a feature vector, including, for each new featureof a plurality of new features, performing other operations comprising:determining, for the new feature, a respective combination method for arespective original feature group comprising a plurality of the originalfeatures of the transaction data; generating values of the new featureby combining corresponding values of the plurality of the originalfeatures based on the respective combination method; computing thefeature label for the new feature based on a sum of differences betweenthe values of the new feature and corresponding transaction labels;providing the feature vector for the new feature as a first input to thetransaction feature generation model to obtain a prediction resultcorresponding to the feature label, and updating parameters of thetransaction feature generation model based on a difference between theprediction result and the feature label for the new feature; receivinganother new feature having a second combination method; computing asecond feature vector for the other new feature according to the secondcombination method; providing the second feature vector for the othernew feature as a second input to the transaction feature generationmodel to obtain a second prediction result for the other new feature;evaluating the other new feature relative to one or more additional newfeatures using the second prediction result for the other new feature;selecting, based on the evaluation, the other new feature as a newtransaction feature for training a model to classify transactions; andusing the other new feature to train the model to classify transactionshaving original feature values including using the second combinationmethod of the other new feature to combine original feature values ofthe transactions.
 12. The non-transitory, computer-readable medium ofclaim 11, wherein the operations further comprise : obtaining theoriginal features from the transaction data wherein two or more of theoriginal features obtained from the transaction data are of a first datatype; and wherein determining the respective combination method for therespective original feature group comprises: determining a combinationmethod that matches the first data type as the respective combinationmethod for the respective original feature group.
 13. Thenon-transitory, computer-readable medium of claim 11, wherein the secondcombination method combines features of a same type as the respectivecombination method.
 14. The non-transitory, computer-readable medium ofclaim 11, wherein the differences between the values of the new featureand the corresponding transaction labels comprise a mean square errorbetween a first value of the values of the new feature and a firsttransaction label of the corresponding transaction labels.
 15. Acomputer-implemented system, comprising: one or more computers; and oneor more computer memory devices interoperably coupled with the one ormore computers and having tangible, non-transitory, machine-readablemedia storing one or more instructions that, when executed by the one ormore computers, perform one or more operations comprising: obtaining atarget dataset, wherein the target dataset comprises transaction data;obtaining transaction feature vectors having respective values for aplurality of original features represented in the transaction data;processing a the transaction feature vectors to train a transactionfeature generation model that generates a feature label for a newfeature represented by a feature vector, including, for each new featureof a plurality of new features, performing other operations comprising :determining, for the new feature, a respective combination method for arespective original feature group comprising a plurality of the originalfeatures of the transaction data; generating values of the new featureby combining corresponding values of the plurality of the originalfeatures of the original feature group based on the respectivecombination method; computing the feature label for the new featurebased on a sum of differences between the values of the vector newfeature and corresponding transaction labels; providing the featurevector for the new feature as a first input to the transaction featuregeneration model to obtain a prediction result corresponding to thefeature label, and updating parameters of the transaction featuregeneration model based on a difference between the prediction result andthe feature label for the new feature; receiving another new featurehaving a second combination method; computing a second feature vectorfor the other new feature according to the second combination method;providing the second feature vector for the other new feature as asecond input to the transaction feature generation model to obtain asecond prediction result for the other new feature; evaluating the othernew feature relative to one or more additional new features using thesecond prediction result for the other new feature; selecting, based onthe evaluation, the other new feature as a new transaction feature fortraining a model to classify transactions; and using the other newfeature to train the model to classify transactions having originalfeature values including using the second combination method of theother new feature to combine original feature values of thetransactions.
 16. The computer-implemented system of claim 15, whereinthe operations further comprise: obtaining the original features fromthe transaction data wherein two or more of the original featuresobtained from the transaction data are of a first data type; and whereindetermining the respective combination method for the respectiveoriginal feature group comprises: determining a combination method thatmatches the first data type as the respective combination method for therespective original feature group.
 17. The computer-implemented systemof claim 15, wherein the second combination method combines features ofa same type as the respective combination method.